package com.se.web.tags;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyTagSupport;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.se.config.Preferences;

public class PreferencesTag extends BodyTagSupport
{
  private static final long serialVersionUID = -1946662271953931844L;
  private String key;

  public int doStartTag()
    throws JspTagException
  {
    try
    {
      WebApplicationContext localWebApplicationContext = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
      Preferences localPreferences = (Preferences)localWebApplicationContext.getBean("config");
      JspWriter localJspWriter = this.pageContext.getOut();
      localJspWriter.print(localPreferences.getString(this.key, ""));
    }
    catch (Exception localException)
    {
      throw new JspTagException(localException.toString());
    }
    return 0;
  }

  public String getKey()
  {
    return this.key;
  }

  public void setKey(String paramString)
  {
    this.key = paramString;
  }
}

/* Location:           D:\DevApp\workspace\DevKsnetWeb9.3\WebContent\WEB-INF\lib\netville-2.2.3.jar
 * Qualified Name:     netville.web.tags.PreferencesTag
 * JD-Core Version:    0.6.2
 */